Getting Error whileInitializing entities [closed]

Posted by R76 on Programmers See other posts from Programmers or by R76
Published on 2012-06-01T03:11:00Z Indexed on 2012/06/01 4:48 UTC
Read the original article Hit count: 203

Filed under:
|
|

I am new'b as WPF Dev. I am developing Window application in WPF using mvvmlight framework. I have created database in Sqlserver compact 4.0. I have made a Ado.net Entity Data Model. When I trying to initialize the Entity object in service it throws the error like:

Error

'The invocation of the constructor on type 'PointOfSale.ViewModels.ProductsViewModel' that matches the specified binding constraints threw an exception.' Line number '7' and line position '10'.

stack Trace

at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at PointOfSale.MainWindow.InitializeComponent() in e:\VarniApplication\PointOfSale\PointOfSale\MainWindow.xaml:line 1
at PointOfSale.MainWindow..ctor() in E:\VarniApplication\PointOfSale\PointOfSale\MainWindow.xaml.cs:line 27

Inner Exception

{"Unable to load the specified metadata resource."}

My code:

xyzEntities entites;
public ctor()
{
    entites = new xyzEntities(); //This line throws an error
}

I have installed sql server compact 4.0 from web installer 3.0. and added the sql server compact toolbox from the extension manager.

Tell me if I am missing something to install or missing something to write code.

© Programmers or respective owner

Related posts about wpf

Related posts about entity-framework